# Archlive <http://archlive-pkg.googlecode.com>

pkgname=ofetion-libpurple
pkgver=402
pkgrel=1
pkgdesc="Libpurple plugin of ofetion"
url="http://ofetion.googlecode.com/"
license="GPL"
arch=(i686 x86_64)
depends=('libpurple' 'libxml2' 'openssl')
makedepends=('cmake' 'mercurial' 'gettext')

_hgroot="https://ofetion.googlecode.com/hg"
_hgrepo="ofetion"

build() {
	cd ${srcdir}/${_hgrepo}
	[ -d build ] && rm -rf build
	mkdir build
	cd build && cmake ../pidgin-ofetion
	make
	strip libopenfetion.so
}

package() {
	cd ${srcdir}/${_hgrepo}/build
	install -Dm755 libopenfetion.so $pkgdir/usr/lib/purple-2/libopenfetion.so
	install -Dm755 zh_CN.gmo $pkgdir/usr/share/locale/zh_CN/LC_MESSAGES/pidgin-ofetion.mo
	install -Dm755 ../pidgin-ofetion/res/openfetion.png $pkgdir/usr/share/pixmaps/pidgin/protocols/16/openfetion.png
	install -Dm755 ../pidgin-ofetion/res/city.xml $pkgdir/usr/share/purple/openfetion/city.xml
	install -Dm755 ../pidgin-ofetion/res/province.xml $pkgdir/usr/share/purple/openfetion/province.xml

}